package com.liz.lizrpccore.beans.proxys.netty;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * @author liangGongWei
 * @description
 * @create 2021-09-22 14:15
 **/

public class RpcProxyHandler extends ChannelInboundHandlerAdapter {

    private Object result;

    public Object getResponse(){
        return result;
    }

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        result = msg;
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        System.out.println("client exception is general");
    }
}
